<?php
require 'db.php';
require 'function.php';
$admin1 = new Manager($link);
if (isset($_POST['submit'])){
    $admin = $_POST['admin'];
    $password = $_POST['password'];
    $email = $_POST['email'];
    $phone = $_POST['phone'];
   
        $query = $admin1->addUser($admin,$password,$email,$phone);
        if ($query){
            header("Location:m_user.php");
        }
        else{
            echo "<script>alert('添加失败！');</script>";
            echo "<script>history.go(-1);</script>";
            header("Location:m_user.php");
        }
    
}

require 'uadd.html';
?>